<style>
	.layui-form-label{width:90px;margin-left: 40px;}
	.layui-form{height: 240px;margin-top: 35px;}
	.layui-input-block{margin-left: 160px!important;margin-top:10px;}
	.layui-textarea{height: 120px!important;}.layui-form-text{display: none;}
</style>
<form class="layui-form"  method="post" id="editForm">
	<input type="hidden" name="ids_str" class="ids_strs" value="">

	<div class="layui-inline">
		<div class="layui-form-item">
			<label class="layui-form-label">订单号：</label>
			<div class="layui-input-block">
				<input type="text" name="client_ordernum"  value=""  placeholder="请输入订单号" class="layui-input client_ordernum_select">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">码数：</label>
			<div class="layui-input-block">
				<input type="text" name="size_name" value=""  placeholder="请输入码数" class="layui-input size_name_select">
			</div>
		</div>
	</div>

	<div class="pop-bottom-bar">
		<input type="hidden" class="field-id" name="id">
		<button type="submit" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="formSubmit3" >确定</button>
		<a href="javascript:parent.layui.layer.closeAll();" class="layui-btn layui-btn-primary ml10">取消</a>
	</div>
</form>


{include file="system@block/layui" /}

<script type="text/javascript">
	layui.use(['jquery', 'layer', 'form'], function() {
		var $ = layui.jquery;
        var layer = layui.layer;
        var form = layui.form;

		//监听提交
		form.on('submit(formSubmit3)', function(data){

			var select_value=$('.client_ordernum_select').val();
			var select_value2=$('.size_name_select').val();

			if(select_value =='' || select_value2 =='' ){
				layer.msg('不能为空', {time: 1800, icon: 2});
				return false;
			}
			//预防重复提交
			var DISABLED='layui-btn-disabled';
			$(':button').addClass(DISABLED);
			$(':button').attr('disabled','disabled');
			setTimeout(function() {
				$(":button").removeClass(DISABLED);
				$(":button").removeAttr('disabled');
			}, 4000);//4秒后才能点击*/

			$.post("{:url('addInvoice')}", {action:'addInvoice',client_ordernum:select_value,size_name:select_value2}, function (res) {
				if (res.code == 1) {
					layer.msg(res.msg, {time: 1800, icon: 1}, function () {
						var index = parent.layer.getFrameIndex(window.name);
						parent.layer.close(index);
						parent.reloadTable();
					});
				} else {
					layer.msg(res.msg, {time: 1800, icon: 2});
				}
			}, 'json');

			return false;
		});

	});
</script>